/*
 * Copyright 2009 Johnson Consulting Services
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * 
 */
package com.johnsoncs.gwt.application.client.validation.impl;

import com.johnsoncs.gwt.application.client.model.QueryPath;
import com.johnsoncs.gwt.application.client.validation.ValidationValue;

/**
 * @author wilj
 *
 */
public class LeafValue implements ValidationValue {
	private final Object value;
	private final QueryPath path;

	public LeafValue(final Object value, final QueryPath path) {
		this.value = value;
		this.path = path;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getAttributeValue(java.lang.Integer)
	 */
	@Override
	public <T> T getAttributeValue(final Integer index) {
		return null;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getAttributeValue(java.lang.String)
	 */
	@Override
	public <T> T getAttributeValue(final String key) {
		return null;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getChild(java.lang.Integer)
	 */
	@Override
	public ValidationValue getChild(final Integer index) {
		return null;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getChild(java.lang.String)
	 */
	@Override
	public ValidationValue getChild(final String key) {
		return null;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getQueryPath()
	 */
	@Override
	public QueryPath getQueryPath() {
		return path;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#getValue()
	 */
	@SuppressWarnings("unchecked")
	@Override
	public <T> T getValue() {
		return (T) value;
	}

	/* (non-Javadoc)
	 * @see com.johnsoncs.gwt.application.client.validation.ValidationValue#size()
	 */
	@Override
	public Integer size() {
		return 0;
	}

}
